package GameBoard;

//Singleton + factory
public class GameBoardFactory
{
    private static final GameBoardFactory instance = new GameBoardFactory();
	public static final String[] extensionsName = {"Jeu de base", "auberge et cathedrale"};
	public static final int[] nbMaxPlayers = {5, 6};
	
	private GameBoardFactory(){}
    
	public final static GameBoardFactory getInstance() 
	{
        return instance;
    }
	
	public GameBoard createGameBoard(String extensionName)
	{
		if(extensionName.equals(extensionsName[0]))
			return new BasicGameBoard();
		else if(extensionName.equals(extensionsName[1]))
			return new CarcassonneModelInnsandCathe();
		else
			return null;
	}
	
	public static int getNbMaxPlayers(String extension)
	{
		for(int i=0; i<extensionsName.length; i++)
			if(extension.equals(extensionsName[i]))
				return nbMaxPlayers[i];
		return -1;
	}
}
